package filenavigation

import (
	"gitlab.local/DO-module/new-filemanage-module/src/service/file_recently"
)

func (n *FileNav) SetRecentlyFunc(fn func(string, string)) {
	n.navigation.recentlyFunc = fn
}

func (n *FileNav) GetRecentlyConf(uname string) (*file_recently.RecentlyConf, error) {
	return n.navigation.Recently.GetRecentlyConf(uname)
}

func (n *FileNav) SetRecentlyConf(uname string, cf *file_recently.RecentlyConf) error {
	return n.navigation.Recently.SetRecentlyConf(uname, cf)
}

// ReadRecently 读取最近数据
func (n *FileNav) ReadRecently(uname string) ([]string, error) {
	return n.navigation.Recently.ReadUserLogs(uname)
}

// WriteRecently 添加最近文件
func (n *FileNav) WriteRecently(uname, path string) {
	go n.navigation.Recently.WriteRecently(uname, path)
}

// DelRecently 删除最近
func (n *FileNav) DelRecently(path []string) error {
	return n.navigation.Recently.DelRecently(path)
}

// IsRecently 判断用户是否有最近文件
func (n *FileNav) IsRecently(uname string) bool {
	return n.navigation.Recently.IsRecently(uname)
}
